/*
 * Copyright (C) 2011 Project R'yleh Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.Arkham;

import java.util.Vector;
import javax.microedition.khronos.opengles.GL10;

import android.util.Log;


public class MeshManager extends Mesh
{
	
	public final Vector<Mesh>  mMeshList = new Vector<Mesh>();
	int counter1 = 0 , counter2 = 0;
	int size ;
	public int tickCount;
	@Override
	public void OnDraw(GL10 gl)
	{
		 
		for(Mesh m: mMeshList)
		{
			m.OnDraw(gl);
			m.onUpdate(gl,tickCount);
			
		}
		/* int size = mMeshList.size();
		 for(counter1 = 0; counter1 < size; counter1++)
		 {
			
			 mMeshList.get(counter1).OnDraw(gl);
			
		 }*/
		 
	}
	
	public void clear()
	{
		mMeshList.clear();
	}
	
	public Mesh get(int location)
	{
		return mMeshList.get(location);
	}
	
	public void add(int location, Mesh object)
	{
		mMeshList.add(location, object);
	}
	
	public boolean add(Mesh object)
	{
		return mMeshList.add(object);
	}
	
	public void remove(int location)
	{
		mMeshList.remove(location);
	}
	public boolean remove(Mesh Object)
	{
		return mMeshList.remove(Object);
	}
	
	public int size()
	{
		return mMeshList.size();
		
	}
	
	

}
